#include <iostream>
#include <queue>
using namespace std;

struct edge {
    int to;
    int weight;
    edge(int a, int b) : to(a), weight(b) {}
    bool operator<(const edge& e) const { return weight < e.weight; }
};

int main() {
    priority_queue<edge,vector<edge>, less<edge>> pq;  // 大根堆
    pq.emplace(3, 10);
    pq.emplace(2, 7);
    pq.emplace(4, 11);
    pq.emplace(3, 10);
    while (!pq.empty()) {
        cout << pq.top().to << " " << pq.top().weight << endl;
        pq.pop();
    }
    return 0;
}